/* pts12Animation.cpp
 *
 * --
 * Copyright (c) 2012, Christophe Huriaux
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * --
 */

#include <packet/pts12Animation.h>
#include <wrapper/JavaStreamWrapper.h>

pts12Animation::pts12Animation()
    : McPacketToServer(0x12), entityId(0), animationId(0)
{
}

pts12Animation::pts12Animation(int32_t entityId, int8_t animationId)
    : McPacketToServer(0x12), entityId(entityId), animationId(animationId)
{
}

unsigned int pts12Animation::length()
{
    return 1 + 4 + 1;
}

void pts12Animation::forge(std::ostream& out)
{
    JavaStreamWrapper jsw(out);

    jsw.writeByte(getPacketId());
    jsw.writeInt(entityId);
    jsw.writeByte(animationId);

}

int32_t pts12Animation::getEntityId()
{
    return entityId;
}

int8_t pts12Animation::getAnimationId()
{
    return animationId;
}


void pts12Animation::setEntityId(int32_t entityId)
{
    this->entityId = entityId;
}

void pts12Animation::setAnimationId(int8_t animationId)
{
    this->animationId = animationId;
}


